1. Field of the Invention
The present invention relates to a method of matching an input image with a reference image, the input image possibly containing an addition or deletion to the reference image and possibly having been subjected to transformations such as positional displacement, stretching/shrinking, and skewing relative to the reference image; a character recognition method, a mismatching portion detection method, and a printing method using the above matching method; an apparatus for implementing these methods; and a storage medium storing programs for implementing these methods.
2. Description of the Related Art
In an optical character reading apparatus (OCR apparatus) designed to read handwritten characters, it is practiced to measure in advance the coordinates of reading regions on a printed form by using a ruler or the like and to store the result as a form descriptor. When a filled-out form is input, character recognition is performed by clipping the same regions by referring to the descriptor. This method requires that the amount of printing misregistration of the form be extremely small, and that the amount of image skew and displacement when the form is input into an image scanner is zero or measurable. Otherwise, characters in the correct positions cannot be read. For this purpose, it is practiced (1) to eliminate the effects of printing misregistration and sheet cutting errors by strictly controlling the printing and cutting accuracies of the form paper and (2) to eliminate skew, image stretching/shrinking, and unsteady feed of the paper by enhancing the transport accuracy of the scanner into which the paper is fed. These necessarily lead to various constraints, imposing limitations on the form design and increasing system cost.
In recent years, there has been a strong need to relax these constraints, and one method of solving this problem has been aligning positions using preprinting such as marks and frame lines preprinted on the form sheet.
In the mark preprinting method, registration marks such as cross-shaped or L-shaped marks are preprinted in the corners of the form sheet in the case of an OCR, for example, and registration is achieved by detecting the marks from the input image. With this method, however, existing forms cannot be used but need to be redesigned to the mark specification, which increases the cost and requires time and labor to correct the form. Furthermore, while positional precision is high near the marks, the precision decreases in regions located farther away from the marks. This is because the transformation parameters (displacement, rotation, and stretching/shrinking) of the input image are not uniform but vary within the image. If the precision is to be enhanced, the number of marks has to be increased, but this is often not allowable for layout reasons.
In view of these problems, there have recently been devised methods which perform matching by relying on elements originally existing in the image, for example, the line segments of a table printed on the form sheet (refer, for example, to Japanese Unexamined Patent Publication Nos. 7-249099, 7-282193, and 8-77294). Matching the lines on the form sheet one by one works well for image distortions, since it has the same effect as increasing the number of marks in the first described method.
These methods, however, have the disadvantage that because of their principle of operation, they can only process printed forms composed of lines. For example, some questionnaire forms require filling in characters in parentheses within printed text or entering date before the printed characters of "Year", "Month", and "Day". The above methods cannot be applied to such questionnaire forms. Since printed forms and slips of the types that require entering a character, for example, within a circle, and that does not use lines are widespread, the methods that perform matching by relying on line segments cannot handle many of the forms currently used.
In view of the above situation, for an image composed of arbitrary graphic elements or characters, not limited only to lines, if an input image, containing an addition/deletion to a reference image and subjected to transformations such as positional displacement, stretching/shrinking, and skewing, can be matched with various portions of the reference image, characters written on a form sheet with no lines or only a limited number of lines printed thereon can be read in the presence of transformations such as positional displacement, stretching/shrinking, and skewing.